package com.foreveross.fetl.vo;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.foreveross.fetl.common.GlobalsConst;

public class TaskTemplateVO {
	private Long id;
	private String name;
	private String areaCode;
	private String areaName;
	private String fromCity;
	private String fromCityName;
	private String toCity;
	private String toCityName;
	private Long grabChannelId;
	private String grabChannel;
	private String attachHbaseKey;
	private int frequency;
	private Date nextGrabTime;
	private Date validityTo;
	private Date validityFrom = new Date();
	private Integer status = GlobalsConst.DATA_STATUS_NORMAL;
	private int priority;
	private int grabScopeEnd;
	private int grabScopeBegin;
	private Integer isReturn = GlobalsConst.DATA_LOGIC_Y;
	private int returnDateScope;
	private Long userId;
	private String userName;
	private String remark;
	private Date createTime = new Date();
	private Integer isInternational;
	private SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
	private SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	public String getAreaName() {
		return areaName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public Long getGrabChannelId() {
		return grabChannelId;
	}

	public void setGrabChannelId(Long grabChannelId) {
		this.grabChannelId = grabChannelId;
	}

	public String getGrabChannel() {
		return grabChannel;
	}

	public void setGrabChannel(String grabChannel) {
		this.grabChannel = grabChannel;
	}

	public String getAttachHbaseKey() {
		return attachHbaseKey;
	}

	public void setAttachHbaseKey(String attachHbaseKey) {
		this.attachHbaseKey = attachHbaseKey;
	}

	public int getFrequency() {
		return frequency;
	}

	public void setFrequency(int frequency) {
		this.frequency = frequency;
	}

	public String getNextGrabTime() {
		return sdf2.format(nextGrabTime);
	}

	public Date getNextGrabTime1() {
		return nextGrabTime;
	}

	public void setNextGrabTime(Date nextGrabTime) {
		this.nextGrabTime = nextGrabTime;
	}

	public void setNextGrabTime(String nextGrabTime) {
		if (null == nextGrabTime || nextGrabTime.isEmpty())
			return;
		try {
			this.nextGrabTime = sdf2.parse(nextGrabTime);
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}

	public String getValidityTo() {
		if(null==validityTo)
			return null;
		return sdf1.format(validityTo);
	}

	public Date getValidityTo1() {
		return validityTo;
	}

	public void setValidityTo(Date validityTo) {
		this.validityTo = validityTo;
	}

	public void setValidityTo(String validityTo) {
		if (null == validityTo || validityTo.isEmpty())
			return;
		try {
			this.validityTo = sdf1.parse(validityTo);
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}

	public String getValidityFrom() {
		if(null==validityFrom)
			return null;
		return sdf1.format(validityFrom);
	}

	public Date getValidityFrom1() {
		return validityFrom;
	}

	public void setValidityFrom(String validityFrom) {
		if (null == validityFrom || validityFrom.isEmpty())
			return;
		try {
			this.validityFrom = sdf1.parse(validityFrom);
		} catch (ParseException e) {
			e.printStackTrace();
		}
	}

	public void setValidityFrom(Date validityFrom) {
		this.validityFrom = validityFrom;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public int getGrabScopeEnd() {
		return grabScopeEnd;
	}

	public void setGrabScopeEnd(int grabScopeEnd) {
		this.grabScopeEnd = grabScopeEnd;
	}

	public int getGrabScopeBegin() {
		return grabScopeBegin;
	}

	public void setGrabScopeBegin(int grabScopeBegin) {
		this.grabScopeBegin = grabScopeBegin;
	}

	public Integer getIsReturn() {
		return isReturn;
	}

	public void setIsReturn(Integer isReturn) {
		this.isReturn = isReturn;
	}

	public int getReturnDateScope() {
		return returnDateScope;
	}

	public void setReturnDateScope(int returnDateScope) {
		this.returnDateScope = returnDateScope;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Integer getIsInternational() {
		return isInternational;
	}

	public void setIsInternational(Integer isInternational) {
		this.isInternational = isInternational;
	}

}
